package com.xbongbong.admin.domain.dao;

import com.xbongbong.admin.domain.entity.BusinessRuleInfoRetainEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * 业务规则-镜像备份
 * @author xingxing.xiao
 * @date 2020/06/11 16:13
 */
@Repository
@Mapper
public interface BusinessRuleInfoRetainDao {

    /**
     * 插入实体
     * @param entity
     * @return
     */
    Integer insert(BusinessRuleInfoRetainEntity entity);

    /**
     * 插入实体
     * @param list
     * @return
     */
    Integer insertBatch(@Param("list") List<BusinessRuleInfoRetainEntity> list);
    /**
     * 更新实体
     * @param entity
     * @return
     */
    Integer update(BusinessRuleInfoRetainEntity entity);

    /**
     * 删除实体
     * @param key
     * @param corpid
     * @return
     */
    Integer deleteByKey(@Param("key") Long key, @Param("corpid") String corpid);

    /**
     * 批量删除
     * @param list 主键id集合
     * @param corpid
     * @author xingxing.xiao
     */
    Integer deleteBatch(@Param("list") List<Long> list, @Param("corpid") String corpid);

    /**
     * 获取单个实体
     * @param key
     * @param corpid
     * @return
     */
    BusinessRuleInfoRetainEntity getByKey(@Param("key") Long key, @Param("corpid") String corpid);

    /**
     * 获取单个实体
     * @param param
     * @return
     */
    List<BusinessRuleInfoRetainEntity> findEntitys(@Param("param") Map<String, Object> param);

    /**
     * 获取单个实体
     * @param param
     * @return
     */
    Integer getEntitysCount(@Param("param") Map<String, Object> param);

}
